feat: add identify protocol support - #327
Conversation
Greptile SummaryThis PR adds Confidence Score: 4/5Safe to merge; the change is minimal, well-documented, and structurally correct. Only P2 findings are present. The logic is sound — identify is correctly wired into the behaviour, the identity keypair refactor is clean, and events are intentionally ignored as documented. The single P2 is a style note about the protocol version string. No files require special attention.
|
| Filename | Overview |
|---|---|
| crates/net/p2p/src/lib.rs | Adds libp2p::identify::Behaviour to the swarm, moves identity keypair construction earlier so it can supply the public key to identify::Config, and intentionally drops all identify events via the catch-all trace branch. Changes are minimal and well-documented. |
Sequence Diagram
sequenceDiagram
participant gean as gean (go-libp2p)
participant ethlambda as ethlambda swarm
gean->>ethlambda: /ipfs/id/1.0.0 identify probe
Note over ethlambda: identify::Behaviour<br/>responds automatically
ethlambda-->>gean: IdentifyInfo (public key, /ipfs/0.1.0, listen addrs)
Note over gean: identify exchange complete —<br/>peer allowed into gossipsub mesh
gean->>ethlambda: gossipsub GRAFT
ethlambda->>gean: gossipsub GRAFT
Prompt To Fix All With AI
This is a comment left during a code review.
Path: crates/net/p2p/src/lib.rs
Line: 167
Comment:
**Protocol version string is ambiguous — consider a more descriptive value**
The `protocol_version` field in `identify::Config::new` is the *agent/application version* advertised to remote peers in the identify response — it is not the protocol negotiation path (`/ipfs/id/1.0.0`, which libp2p handles internally). Using a bare `/ipfs/0.1.0` may cause gean or other peers to misidentify this node as a generic IPFS node. Ethereum consensus clients typically advertise a more specific string (e.g. `/eth2/1.0.0` or a project-specific path). If zeam intentionally uses `/ipfs/0.1.0` for compatibility reasons that's fine to keep, but it's worth a comment explaining why this value was chosen over a project-specific one.
How can I resolve this? If you propose a fix, please make it concise.Reviews (1): Last reviewed commit: "feat: add identify protocol support" | Re-trigger Greptile
🤖 Kimi Code ReviewOverall Assessment: Correct and idiomatic libp2p integration for go-libp2p interop. No security vulnerabilities identified. Specific Comments:
Security & Consensus Notes:
Verdict: Approve with minor documentation suggestions. Automated review by Kimi (Moonshot AI) · kimi-k2.5 · custom prompt |
🤖 Claude Code ReviewNow I have everything I need to write a thorough review. PR #327 — Add identify protocol supportOverviewThis PR registers Code QualityPositive:
Concerns and Observations1. The code uses The 2. Identify events flow to wildcard
No action needed now, but worth a 3.
4. Dependency — The 5. Event queue noise at scale With identify enabled, every new peer connection generates at minimum one Minor Style NoteThe inline comment SummaryThe change is correct, minimal, and well-motivated. The Automated review by Claude (Anthropic) · sonnet · custom prompt |
🤖 Codex Code ReviewFindings
Non-blocking Note
Testing Gap
Automated review by OpenAI Codex · gpt-5.4 · custom prompt |
Recent interop tests suggested gean rejects ethlambda peers due to us missing
idprotocol support. This PR adds support for this, similar to how zeam and ream have it.